/*
* // +-------------------------------------------------------------------------------------------------
* // |                 有你就好 [ 有节骨乃坚，无心品自端 ]     <http://encoding.wang>
* // +-------------------------------------------------------------------------------------------------
* // |                             独在异乡为异客         每逢佳节倍思亲
* // +-------------------------------------------------------------------------------------------------
* // |                 联系:   <707069100@qq.com>      <http://weibo.com/513778937>
* // +-------------------------------------------------------------------------------------------------
*/

// -----------------------------------------------------------------------------------------------------
// +----------------------------------------------------------------------------------------------------
// |                   ErYang出品 属于小极品          共同学习    共同进步
// +----------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------


package wang.encoding.mroot.common.config


import org.springframework.cache.annotation.EnableCaching
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import javax.cache.Cache
import javax.cache.CacheManager


/**
 * Ehcache3 缓存
 *
 * @author ErYang
 */
@Configuration
@EnableCaching
class Ehcache3Configuration {

    companion object {

        /**
         * 缓存分隔符
         */
        const val CACHE_SEPARATOR = "_"
        /**
         * configCache
         */
        const val CONFIG_CACHE = "configCache"


    }

    // -------------------------------------------------------------------------------------------------


    /**
     * 托管在配置文件 xml 定义的 configCache
     *
     * @param cacheManager CacheManage
     * @return Cache<Any,Any>
     */
    @Suppress("SpringKotlinAutowiring")
    @Bean(name = [CONFIG_CACHE])
    fun configCache(cacheManager: CacheManager): Cache<Any, Any>? {
        return cacheManager.getCache(CONFIG_CACHE)
    }

    // -------------------------------------------------------------------------------------------------

}

// -----------------------------------------------------------------------------------------------------

// End Ehcache3Configuration class

/* End of file Ehcache3Configuration.kt */
/* Location: ./src/main/kotlin/wang/encoding/mroot/common/config/Ehcache3Configuration.kt */

// -----------------------------------------------------------------------------------------------------
// +----------------------------------------------------------------------------------------------------
// |                           ErYang出品 属于小极品  O(∩_∩)O~~   共同学习    共同进步
// +----------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------
